package sg20.task2;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;
public class TaskTwoUniversityMapper extends Mapper<LongWritable, Text, LongWritable, Text>{
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, LongWritable, Text>.Context context) throws IOException, InterruptedException {

        String[] vals = value.toString().split("\\|");
        int idx = Integer.parseInt(vals[0]);
        context.write(new LongWritable(idx), new Text("$#" + vals[0] + "|" + vals[1] + "|" + vals[4]));


    }
}
